package com.gtw.modules.api.controller;

import com.gtw.common.annotation.AuthIgnoreApi;
import com.gtw.common.annotation.LoginUserApi;
import com.gtw.common.utils.R;
import com.gtw.modules.entity.TbOrder;
import com.gtw.modules.entity.TbUser;
import com.gtw.utils.BankUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/validatebank")
public class ValidateBankController {

    /**
     * 校验银行卡
     */
    @AuthIgnoreApi
    @RequestMapping("/validate")
    public R validate(String bank) {
        String bankname = BankUtil.getNameOfBank(bank);
        if (bankname.equals("") || bankname.equals(null)) {
            return R.error("银行卡格式错误！");
        }
        return R.ok().put("data", bankname);
    }
}
